<?php
$id=$_GET['id'];

	$cache=new cache;

	$user=get_user_by_username($id);
	if($id){
				$data['user']=$user;
					
				$cache=new cache;
				$og_url=HOME."blog/user/".$user['username']."/";
				//-------------------------- GET LIST BAI VIET CATEGORY ----------------
				$sql ="SELECT id,name,alias,upload_user,upload_time from blog_post where upload_user='".$user['username']."' and status=1 order by id desc ";
				$sql2="SELECT id from blog_post where  upload_user='".$user['username']."' and status=1";
			
				$pager = new Pagination($sql, 20, 5,$og_url,0,"blog_get_user");
				$pager->setDebug(false);
				$cache=new cache;
				$data[info] = $pager->paginate($cache,$sql2);
				$data[nav]	= $pager->renderFullNav();
	
			
		
	}else{
			header('HTTP/1.0 404 Not Found');
			redirect(HOME.'404.html');
			die();
		}
			$data1['title']=web_title("Blog của  $id | Blog");
			$data1['mota']=web_des("Các bài blog của $id trên Truyencuatui.info");
			$data1['keyword']=web_keyword("Blog,truyencuatui.info,$id,bai viet cua $id,blog cua $id");
	

loadview('template/header_blog',$data1);
loadview("blog/user",$data);
loadview('template/footer_blog');
exit();